From d5a09342c4fa8759a64374e4b01fd7a7e491fb90 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 1 Mar 2009 07:39:03 +0000 Subject: [PATCH] If pure sniffing yields uncertain results, try again with the filename. * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing yields uncertain results, try again with the filename. Patch by Tyler Lawson svn path=/trunk/; revision=22433 --- gdk-pixbuf/ChangeLog | 9 +++++++++ gdk-pixbuf/gdk-pixbuf-io.c | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 385577a4ad..d16222dbcb 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,12 @@ +2009-03-01 Matthias Clasen + + Bug 569671 – gdk_pixbuf_new_from_file() can't open + image/x-portable-pixmap + + * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing + yields uncertain results, try again with the filename. + Patch by Tyler Lawson + 2009-02-17 Matthias Clasen * === Released 2.15.4 === diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index b1b9be24bd..abb920359e 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -793,8 +793,11 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size, gchar **mimes; gchar *type; gint j; + gboolean uncertain; - mime_type = g_content_type_guess (NULL, buffer, size, NULL); + mime_type = g_content_type_guess (NULL, buffer, size, &uncertain); + if (uncertain) + mime_type = g_content_type_guess (filename, buffer, size, NULL); for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { GdkPixbufModule *module = (GdkPixbufModule *)modules->data; -- 2.30.2